package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.common.result.R;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/user")
public class UserController {

    
    @PostMapping("/login")
    public R login(@RequestBody Map<String,Object> map){
        System.out.println(map);
        return R.ok().data("token", "admin-token");
    }

    @GetMapping("/info")
    public R info(String token){
        List<String> list=new ArrayList<String>();
        list.add("admin");
        return R.ok().data("roles",list)
                     .data("introduction","I am a super administrator")
                     .data("avatar","https://img0.baidu.com/it/u=2643499807,2653780445&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=608")
                     .data("name", "Super Admin");
    }



}
